package com.aiyige.model;

/**
 * 三方绑定model
 */
public class ThirdOauthModel {

    // weixin,qq,weibo
    public static final String SOURCE_QQ = "qq";

    public static final String SOURCE_SINA = "sina";

    public static final String SOURCE_WEIXIN = "weixin";

    String source;
    String uid;
    String openid;
    String avatar;
    String nickName;
    String accessToken;

    private ThirdOauthModel(Builder builder) {
        source = builder.source;
        uid = builder.uid;
        openid = builder.openid;
        avatar = builder.avatar;
        nickName = builder.nickName;
        accessToken = builder.accessToken;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static final class Builder {
        private String source;
        private String uid;
        private String openid;
        private String avatar;
        private String nickName;
        private String accessToken;

        private Builder() {
        }

        public Builder source(String val) {
            source = val;
            return this;
        }

        public Builder uid(String val) {
            uid = val;
            return this;
        }

        public Builder openid(String val) {
            openid = val;
            return this;
        }

        public Builder avatar(String val) {
            avatar = val;
            return this;
        }

        public Builder nickName(String val) {
            nickName = val;
            return this;
        }

        public Builder accessToken(String val) {
            accessToken = val;
            return this;
        }

        public ThirdOauthModel build() {
            return new ThirdOauthModel(this);
        }
    }
}
